import request from '@/utils/request'

export function getMarketOrderListApi(data) {
  return request({
    url: '/order/pageInfo',
    method: 'post',
    data
  })
}

export function getCouponListApi(data) {
  return request({
    url: '/coupon/pageInfo',
    method: 'post',
    data
  })
}

export function saveCouponApi(data) {
  return request({
    url: '/coupon/save',
    method: 'post',
    data
  })
}

export function changeStateApi(data) {
  return request({
    url: '/coupon/changeState',
    method: 'post',
    data
  })
}

export function getCertificateListApi(data) {
  return request({
    url: '/certificate/pageInfo',
    method: 'post',
    data
  })
}

export function saveCertificateApi(data) {
  return request({
    url: '/certificate/save',
    method: 'post',
    data
  })
}

export function getApplyListApi(data) {
  return request({
    url: '/userCertificateApply/pageInfo',
    method: 'post',
    data
  })
}

export function applyResultApi(data) {
  return request({
    url: '/userCertificateApply/apply',
    method: 'post',
    data
  })
}


export function getCertPersonListApi(certificateId) {
  return request({
    url: `/userCertificate/getUsersIdsByCertificateId/${certificateId}`,
    method: 'post',
  })
}

export function saveCertPersonApi(data) {
  return request({
    url: '/userCertificate/save',
    method: 'post',
    data
  })
}

export function getCertLogisticsListApi(data) {
  return request({
    url: `/userCertificateLogistics/pageInfo`,
    method: 'post',
    data
  })
}

export function getCertUserDetailApi(userId, certificateId) {
  return request({
    url: `/app/getUserCertificateIdDetail/${userId}/${certificateId}`,
    method: 'post',
  })
}

export function saveUserCertificateLogisticsApi(data) {
  return request({
    url: `/userCertificateLogistics/save`,
    method: 'post',
    data
  })
}

export function sendEmailApi(data) {
  return request({
    url: `/userCertificateLogistics/sendEmail`,
    method: 'post',
    data
  })
}